class AX
{
	public void doThis()
	{
		System.out.println("AX");
	}
}
class BX extends AX
{
	public void doThis()
	{
		System.out.println("BX");
	}	
}
class CX extends AX
{
	public void doThis()
	{
		System.out.println("CX");
	}	
}
class DX extends CX
{
	public void doThis()
	{
		System.out.println("DX");
	}	
}

public class Example
{
	public static void main(String arg[])
	{
		AX ax = new AX();
		BX bx = new BX();
		CX cx = new CX();
		DX dx = new DX();
		
		AX [] testArray = {ax,bx,cx,dx};
		
		testArray[0].doThis();
		testArray[1].doThis();
		testArray[2].doThis();
		testArray[3].doThis();
	}
	
}